Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement import of WebDAV folders #5914

Merged
merged 43 commits into from
Jan 13, 2025
Merged

Implement import of WebDAV folders #5914

merged 43 commits into from
Jan 13, 2025

Conversation

nirvn
Copy link
Member

@nirvn nirvn commented Dec 25, 2024

This PR enables QField to import a remote WebDAV folder into its imported projects' local storage. The functionality is available in the bottom right (+) import button within the local file picker section:

image

The PR is the foundational stone to implement simple download/upload synchronization once a folder is imported. That will come in a subsequent set of commits.

The PR also implements a download from and uploading to webdav server for imported webdav folders. The new pair of actions appear in the local file picker for any folder that is the root of an imported webdav folder, or any of its child folder:

image

When downloading/uploading against the root folder, all content will be pushed/pulled. If executed against a child folder, only that child folder will be considered. For both actions, files will be downloaded or uploaded whenever the last modified date does not match. It's a simple logic that is easy for users to understand.

A pair of download/upload actions has also been added into the (current) project folder's root view, provided the project resides within a webdav imported folder:

image

That makes for a nice UX where users don't need to drill down into a large list of imported folders.

Finally, when triggering a download or upload, QField will request a confirmation, informing users of data being overwritten:

image

@suricactus , I am wondering whether we should upgrade the QFieldCloudConnection class to also make use of the authentication manager to store / retrieve remembered passwords (see implementation here).

Edit: I should have mentioned that this work benefited from the pre-existing QtWebDAV library (this fork - https://github.com/PikachuHy/QtWebDAV - which itself was a fork of https://github.com/mhaller/qwebdavlib). We have taken the time to modernize its cmake configuration and add some extra functionality. Our fork lives here: https://github.com/m-kuhn/QtWebDAV

@qfield-fairy
Copy link
Collaborator

qfield-fairy commented Dec 25, 2024

@nirvn nirvn force-pushed the qtwebdav_port branch 2 times, most recently from 8983269 to 719940b Compare December 25, 2024 09:36
@m-kuhn
Copy link
Member

m-kuhn commented Dec 27, 2024

@nirvn let's put this into "draft" until actual code has landed that can be tested and eventually merged

@m-kuhn m-kuhn marked this pull request as draft December 27, 2024 06:34
@nirvn nirvn changed the title Add a qtwebdav vcpkg port Implement import of WebDAV folders Jan 4, 2025
@nirvn nirvn marked this pull request as ready for review January 4, 2025 09:34
@nirvn nirvn force-pushed the qtwebdav_port branch 2 times, most recently from d497e20 to 63353e7 Compare January 7, 2025 02:23
@suricactus
Copy link
Collaborator

@suricactus , I am wondering whether we should upgrade the QFieldCloudConnection class to also make use of the authentication manager to store / retrieve remembered passwords (see implementation here).

Absolutely, it was in my head as a TODO for a long time and it finally evaporated. I will add it to the backlog. Personally I cannot handle the implementation in the upcoming weeks. See the task here: https://app.clickup.com/t/86c1hean6

@Guts
Copy link

Guts commented Jan 8, 2025

Thanks for the work.

Edit: I should have mentioned that this work benefited from the pre-existing QtWebDAV library (this fork - https://github.com/PikachuHy/QtWebDAV - which itself was a fork of https://github.com/mhaller/qwebdavlib). We have taken the time to modernize its cmake configuration and add some extra functionality. Our fork lives here: https://github.com/m-kuhn/QtWebDAV

Are the upstream projects aware of this work? Is a PR to merge those modernization in upstream projects is planned? Or upstream projects are dead?

@m-kuhn
Copy link
Member

m-kuhn commented Jan 8, 2025

I have opened PR's here: https://github.com/PikachuHy/QtWebDAV/pulls with not response so far.
I did not open anything on https://github.com/mhaller/qwebdavlib/pulls as this seems to be completely unresponsive. What we could do there is open an issue and try to get in touch with other forks to see if someone else wants to consolidate.

@Guts
Copy link

Guts commented Jan 8, 2025

OK, nice. If you have time to do it I suggest to open an issue to broadcast your fork yes to have more chances to get consolidation effort from other third-parties.

@m-kuhn
Copy link
Member

m-kuhn commented Jan 8, 2025

I hesitated so far as I wasn't sure if we should potentially put this under an organisation umbrella (e.g. QGIS)

@nirvn nirvn force-pushed the qtwebdav_port branch 4 times, most recently from 5545ccf to cff88e4 Compare January 12, 2025 06:16
nirvn added 24 commits January 12, 2025 14:43
Copy link
Collaborator

@mohsenD98 mohsenD98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, I have not test APK, i just read the codes and its clean 👍
adding small comments.

src/qml/MessageLog.qml Show resolved Hide resolved
src/qml/QFieldLocalDataPickerScreen.qml Outdated Show resolved Hide resolved
@nirvn nirvn merged commit 3cccd35 into master Jan 13, 2025
24 of 25 checks passed
@nirvn nirvn deleted the qtwebdav_port branch January 13, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants